package com.dynamixsoftware.printershare.bt;

import android.content.Context;
import android.content.Intent;
import android.content.IntentFilter;
import android.os.Build;
import android.os.Build.VERSION;
import java.util.UUID;

public abstract class BTAdapter {
	public static BTAdapter getDefault(Context paramContext) throws Exception {
		if (Integer.parseInt(Build.VERSION.SDK) > 4) {
			return BTAdapterImpl20.getDefault(paramContext);
		}
		return BTAdapterImpl16.getDefault(paramContext);
	}

	public void cancelDiscovery() throws Exception {
		doCancelDiscovery();
		int i = 0;
		while (i < 3) {
			try {
				Thread.sleep(500L);
				if (!isDiscovering()) {
					return;
				}
				Thread.sleep(500L);
				i++;
			} catch (InterruptedException localInterruptedException) {
			}
		}
	}

	abstract boolean createBond(String paramString) throws Exception;

	abstract BTSocket createInsecureRfcommSocket(String paramString, int paramInt) throws Exception;

	abstract BTSocket createInsecureRfcommSocketToServiceRecord(String paramString, UUID paramUUID) throws Exception;

	abstract BTSocket createRfcommSocket(String paramString, int paramInt) throws Exception;

	abstract BTSocket createRfcommSocketToServiceRecord(String paramString, UUID paramUUID) throws Exception;

	public abstract void doCancelDiscovery() throws Exception;

	public abstract void doStartDiscovery() throws Exception;

	abstract boolean getBondState(String paramString) throws Exception;

	public abstract String getBondStateChangedIntentAction();

	public abstract IntentFilter getDiscoveryIntentFilter();

	public abstract BTDevice getRemoteDevice(String paramString) throws Exception;

	public abstract boolean isDiscovering() throws Exception;

	public abstract boolean isEnabled() throws Exception;

	public abstract BTDevice parseDiscoveryIntentResult(Intent paramIntent) throws Exception;

	public void startDiscovery() throws Exception {
		doStartDiscovery();
		int i = 0;
		while (i < 3) {
			try {
				Thread.sleep(500L);
				if (isDiscovering()) {
					return;
				}
				Thread.sleep(500L);
				i++;
			} catch (InterruptedException localInterruptedException) {
			}
		}
	}
}

/*
 * Location:
 * C:\Users\Admin\Desktop\Decompiler\JAD\jd-gui-0.3.6.windows\classes_dex2jar
 * .jar
 * 
 * Qualified Name: com.dynamixsoftware.printershare.bt.BTAdapter
 * 
 * JD-Core Version: 0.7.0.1
 */